<?php

namespace Modules\Admin\Http\Requests\Notice;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use HiCommon\Helper;
class NoticeRequest extends FormRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'=>[
                'required',
                'max:20',
            ],
            'content'=>[
                'required',
            ],
            'times'=>[
                'required',
            ]
        ];
    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }
    public function messages()
    {
        return [
            'title.required'=>'请输入公告名称',
            'title.max'=>'公告名称不能超过20字',
            'content.required'=>'请输入公告内容',
            'times.required'=>'请选择开始结束时间',
        ];
    }
}